package com.ruoyi.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 预警规则表
 * @TableName warning_rule
 */
@TableName(value ="warning_rule")
@Data
public class WarningRule implements Serializable {
    /**
     * 预警规则id
     */
    @Excel(name = "预警规则id", prompt = "预警规则id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 体温上限值
     */
    @Excel(name = "体温上限值", prompt = "体温上限值")
    @TableField(value = "temperature_s")
    private String temperatureS;

    /**
     * 体温下限值
     */
    @Excel(name = "体温下限值", prompt = "体温下限值")
    @TableField(value = "temperature_down_x")
    private String temperatureDownX;

    /**
     * 血压上限值
     */
    @Excel(name = "血压上限值", prompt = "血压上限值")
    @TableField(value = "blood_pressure_s")
    private String bloodPressureS;

    /**
     * 血压下限值
     */
    @Excel(name = "血压下限值", prompt = "血压下限值")
    @TableField(value = "blood_pressure_x")
    private String bloodPressureX;

    /**
     * 呼吸频率上限值
     */
    @Excel(name = "呼吸频率上限值", prompt = "呼吸频率上限值")
    @TableField(value = "respiratory_rate_s")
    private String respiratoryRateS;

    /**
     * 呼吸频率下限值
     */
    @Excel(name = "呼吸频率下限值", prompt = "呼吸频率下限值")
    @TableField(value = "respiratory_rate_x")
    private String respiratoryRateX;

    /**
     * 血氧饱和度上限值，百分比
     */
    @Excel(name = "血氧饱和度上限值，百分比", prompt = "血氧饱和度上限值，百分比")
    @TableField(value = "oxygen_saturation_s")
    private String oxygenSaturationS;

    /**
     * 血氧饱和度下限值，百分比
     */
    @Excel(name = "血氧饱和度下限值，百分比", prompt = "血氧饱和度下限值，百分比")
    @TableField(value = "oxygen_saturation_x")
    private String oxygenSaturationX;

    /**
     * 检测结果0阴性1阳性
     */
    @Excel(name = "检测结果0阴性1阳性", prompt = "检测结果0阴性1阳性")
    @TableField(value = "detection_result")
    private String detectionResult;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)//创建与修改时自动填充
    private Date createTime;

    /**
     * 更新时间
     */
    @Excel(name = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)//创建与修改时自动填充
    private Date updateTime;

    /**
     * 逻辑删除
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    /**
     * 0启用1禁用
     * */
    @Excel(name = "0启用1禁用")
    @TableField(value = "state")
    private Integer state;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WarningRule other = (WarningRule) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTemperatureS() == null ? other.getTemperatureS() == null : this.getTemperatureS().equals(other.getTemperatureS()))
            && (this.getTemperatureDownX() == null ? other.getTemperatureDownX() == null : this.getTemperatureDownX().equals(other.getTemperatureDownX()))
            && (this.getBloodPressureS() == null ? other.getBloodPressureS() == null : this.getBloodPressureS().equals(other.getBloodPressureS()))
            && (this.getBloodPressureX() == null ? other.getBloodPressureX() == null : this.getBloodPressureX().equals(other.getBloodPressureX()))
            && (this.getRespiratoryRateS() == null ? other.getRespiratoryRateS() == null : this.getRespiratoryRateS().equals(other.getRespiratoryRateS()))
            && (this.getRespiratoryRateX() == null ? other.getRespiratoryRateX() == null : this.getRespiratoryRateX().equals(other.getRespiratoryRateX()))
            && (this.getOxygenSaturationS() == null ? other.getOxygenSaturationS() == null : this.getOxygenSaturationS().equals(other.getOxygenSaturationS()))
            && (this.getOxygenSaturationX() == null ? other.getOxygenSaturationX() == null : this.getOxygenSaturationX().equals(other.getOxygenSaturationX()))
            && (this.getDetectionResult() == null ? other.getDetectionResult() == null : this.getDetectionResult().equals(other.getDetectionResult()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTemperatureS() == null) ? 0 : getTemperatureS().hashCode());
        result = prime * result + ((getTemperatureDownX() == null) ? 0 : getTemperatureDownX().hashCode());
        result = prime * result + ((getBloodPressureS() == null) ? 0 : getBloodPressureS().hashCode());
        result = prime * result + ((getBloodPressureX() == null) ? 0 : getBloodPressureX().hashCode());
        result = prime * result + ((getRespiratoryRateS() == null) ? 0 : getRespiratoryRateS().hashCode());
        result = prime * result + ((getRespiratoryRateX() == null) ? 0 : getRespiratoryRateX().hashCode());
        result = prime * result + ((getOxygenSaturationS() == null) ? 0 : getOxygenSaturationS().hashCode());
        result = prime * result + ((getOxygenSaturationX() == null) ? 0 : getOxygenSaturationX().hashCode());
        result = prime * result + ((getDetectionResult() == null) ? 0 : getDetectionResult().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", temperatureS=").append(temperatureS);
        sb.append(", temperatureDownX=").append(temperatureDownX);
        sb.append(", bloodPressureS=").append(bloodPressureS);
        sb.append(", bloodPressureX=").append(bloodPressureX);
        sb.append(", respiratoryRateS=").append(respiratoryRateS);
        sb.append(", respiratoryRateX=").append(respiratoryRateX);
        sb.append(", oxygenSaturationS=").append(oxygenSaturationS);
        sb.append(", oxygenSaturationX=").append(oxygenSaturationX);
        sb.append(", detectionResult=").append(detectionResult);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
